/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package PackageMaker.UI;

import PackageMaker.Config.ConfigModel;
import java.io.File;

/**
 *
 * @author wcss
 */
public class ConfigManager 
{
   public static ConfigModel config = new ConfigModel();

    public static void loadConfig()
    {
        if (new File("/etc/builderconfig.cfg").exists())
        {
            try {
                config = ConfigModel.load("/etc/builderconfig.cfg");
            } catch (Exception e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            }
        }
        saveConfig();
    }
    public static void saveConfig()
    {
        try {
            ConfigModel.save(config, JAppToolKit.JRunHelper.getUserHomeDirPath() + "/builderconfig.cfg");
        } catch (Exception e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }    
}
